﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using CourseSystem.Core.BLL;

namespace CourseSystem.Common.Helpers
{
    public class TeacherHelper
    {
        public static List<SelectListItem> GetTeacher(bool needDef=true)
        {
            var list = TeacherBLL.GetAllTeacher();
            var re = list.Select(item => new SelectListItem { Value = item.Id.ToString(), Text = item.Name }).ToList();
            if (needDef)
                re.Insert(0, new SelectListItem { Text = "请选择", Value = "0" });
            return re;
        }
    }
}
